package study.chapter02.innerclass;
//内部接口
public class Outer3 {
    private String msg = "我是外部类";
    public void print(){
        Inner inner = new Inner();
        inner.innerPrint();
    }

    public class Inner{
        private String msg = "我是内部类";
        public void innerPrint(){
            //访问内部类的msg
            System.out.println(msg);
            //访问外部类的msg
            System.out.println(Outer3.this.msg);
        }
    }

    public static void main(String[] args) {
        Outer3 out = new Outer3();
        out.print();

        System.out.println("====================");

        //内部类实例化
        Outer3.Inner inner = new Outer3().new Inner();
        inner.innerPrint();

    }
}
